package com.liaogui.framework.protocol;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
import java.util.Random;

/**
 * @author liaogui
 * @date 2025/4/18 14:55
 */
public class RandomLoadBalance extends AbstractLoadBalance{

    @Override
    public URL doSelect(List<String> urls) throws MalformedURLException {
        Random random = new Random();
        int i = random.nextInt(urls.size());
        URL url = new URL(urls.get(i));
        return url;
    }
}
